/* GUARD */
#ifndef __TIMER_H
#define __TIMER_H

/* INCLUSIONS */
#include "lpc_types.h"
#include "LPC17xx.h"
#include "lpc17xx_timer.h"
#include "debug_frmwrk.h"
#include "lpc17xx_pinsel.h"

#include <stdlib.h>
#include <stdio.h>

/* DEFINITIONS */

/* GLOBAL VARIABLES */

/* FUNCTION PROTOTYPES */

// CONFIGURE TIMER $TIMER WITH BASIC PARAMETERS.
void TIMER_INIT(LPC_TIM_TypeDef* TIMER, uint32_t PRESCALE_VALUE);
 
// CONFIGURE A MATCH REGISTER ON PIN 28 FOR USE WITH TIMER $TIMER;
void TIMER_MATCH_CFG(TIM_MATCHCFG_Type * MCFG, LPC_TIM_TypeDef* TIMER, uint32_t MVALUE);

// EDIT THE MATCH VALUE OF *$CFG.
void TIMER_MVALUE_EDIT(TIM_MATCHCFG_Type * CFG, uint32_t VALUE);   

void TIMER_ENABLE(LPC_TIM_TypeDef* TIMER); // ENABLE THE TIMER POINTED TO BY $TIMER;

void TIMER_DISABLE(LPC_TIM_TypeDef* TIMER); // DISABLE THE TIMER POINTED TO BY $TIMER;

#endif
